use ConspiracyCOVID_data, clear

capture cd // Set own working directory
set scheme s1mono
capture ssc install blindschemes, replace all

***********************
*** Main manuscript ***
***********************

***Figure 1: Distribution of conspiratorial beliefs
hist covid1 [fweight=fweight], title("COVID: The origin is not natural") bin(9) xtitle("") ytitle(, height(5)) xlabel(0.21 `""Completely" "disagree""' 1.1 `""Somewhat" "disagree""' 1.99 `""Neither agree" "nor disagree""' 2.89 `""Somewhat" "agree""' 3.77 `""Completely " "agree ""')  color(%60) scale(0.8) percent name(consp1, replace) 
 
hist covid2 [fweight=fweight], title("COVID: It was disseminated on purpose") bin(9) xtitle("") ytitle(, height(4)) xlabel(0.21 `""Completely" "disagree""' 1.1 `""Somewhat" "disagree""' 1.99 `""Neither agree" "nor disagree""' 2.89 `""Somewhat" "agree""' 3.77 `""Completely " "agree ""') color(%60) scale(0.8) percent name(consp2, replace) 
 
hist covid3 [fweight=fweight], title("COVID: Is the result of a cover war") bin(9) xtitle("") ytitle(, height(4)) xlabel(0.21 `""Completely" "disagree""' 1.1 `""Somewhat" "disagree""' 1.99 `""Neither agree" "nor disagree""' 2.89 `""Somewhat" "agree""' 3.77 `""Completely " "agree ""') color(%60) scale(0.8) percent name(consp3, replace) 
 
hist rec_secret [fweight=fweight], title("Secret organizations influencing politics") bin(9) xtitle("") ytitle(, height(4)) xlabel(0.21 `""Completely" "disagree""' 1.1 `""Somewhat" "disagree""' 1.99 `""Neither agree" "nor disagree""' 2.89 `""Somewhat" "agree""' 3.77 `""Completely " "agree ""') color(%60) scale(0.8) percent  name(consp4, replace) 

graph combine consp1 consp2 consp3 consp4, ycommon col(2) scheme(s1mono) scale(0.95) name(f1_hist_conspiracy, replace)
graph export "f1_hist_conspiracy.png", replace 
graph close consp1 consp2 consp3 consp4

***Figure 2. The correlates for specific COVID-19 and general conspiratorial beliefs

global controls " woman c.age i.edu i.mun "
 
eststo clear 
eststo COVIDw1: reg conspir_covid ideol $controls [weight=weight]
eststo COVIDw2: reg conspir_covid ideol $controls authority_cont [weight=weight]
eststo COVIDw3: reg conspir_covid ideol $controls freedom_cont[weight=weight]
eststo COVIDw4: reg conspir_covid ideol $controls like_incumbent [weight=weight]
eststo COVIDw5: reg conspir_covid ideol $controls authority_cont freedom_cont like_incumbent [weight=weight]

eststo Conspiracyw1: reg rec_secret ideol $controls  [weight=weight]
eststo Conspiracyw2: reg rec_secret ideol $controls authority_cont [weight=weight]
eststo Conspiracyw3: reg rec_secret ideol $controls freedom_cont[weight=weight]
eststo Conspiracyw4: reg rec_secret ideol $controls like_incumbent [weight=weight]
eststo Conspiracyw5: reg rec_secret ideol $controls authority_cont freedom_cont like_incumbent [weight=weight]

global coeflabels "coeflabels(woman= "Woman" age="Age" 1.mun ="Mun.size: House in countryside" 2.mun ="Mun.size: Small/medium city" 3.mun ="Mun.size: Big city/outskirts" 1.edu="Education: primary" 2.edu="Education: Secondary" 3.edu="Education: University"  1.freedom="Freedom before security" ,  labsize(small) wrap(90))"

coefplot (COVIDw1, label (Baseline)) (COVIDw2, label (+Authority)) (COVIDw3, label(+Security)) (COVIDw4, label (+Incumbent)) (COVIDw5, label (All variables)) , bylabel(COVID-19 CB) ||  (Conspiracyw1, label (Baseline)) (Conspiracyw2, label (+Authority)) (Conspiracyw3, label(+Security)) (Conspiracyw4, label (+Incumbent)) (Conspiracyw5, label (All variables)), bylabel(General CB) || , drop(_cons woman 0.woman 1.woman age 1.edu 2.edu 3.edu 1.mun 2.mun 3.mun 4.mun 5.mun) $coeflabels  legend(position(5) row(1) size(small)) xline(0) scale(0.7) name(f2_ols, replace)

graph export "f2_ols.png", replace
 
eststo clear 


*****************************************************************************************************************
*****************************************************************************************************************

******************************
*** Supplemental materials ***
******************************

***Table S2a. Descriptive statistics
tab mun, gen(mun_)
label variable mun_1 "  A village or a house in the countryside"
label variable mun_2 "  A small or medium-size city"
label variable mun_3 "  A big city or its outskirts"

tab edu, gen(edu_)
label variable edu_1 "  Primary"
label variable edu_2 "  Secondary"
label variable edu_3 "  University"

sum conspir_covid rec_secret conspir_dif woman age edu_* mun_* interest ideol freedom_cont authority_cont like_incumbent [weight=weight]
drop mun_* edu_*

***Table S2b. Pearson’s correlations between the main variables in this study.
pwcorr conspir_covid rec_secret ideol freedom_cont authority_cont like_incumbent, star(0.99)

***Table S3a: Estimation of General and specific conspiratorial beliefs
global controls " woman c.age i.edu i.mun  ideol freedom_cont authority_cont like_incumbent"
eststo clear 
eststo COVIDw: reg conspir_covid $controls [weight=weight]
eststo Conspiracyw: reg rec_secret $controls  [weight=weight]

esttab COVIDw Conspiracyw using "ts3a_Regressiontable.rtf", b(3) se(3) r2 label nonum nogaps refcat(2.mun "Mun.size: House countryside") drop(1.mun) replace

***Table S3b. OLS regression for general conspiratorial beliefs (2018 representative survey)
*Append database from 2018
append using "ConspiracyGENERAL_data"
replace surveycovid=1 if surveycovid==.
label define surveycovid 0 "2018 CB survey" 1 "2020 COVID survey"
label values surveycovid surveycovid 
replace weight=1 if surveycovid==0

eststo Conspiracy_pre: reg rec_secret $controls [weight=weight] if surveycovid==0
esttab Conspiracy_pre using "ts3b_CB2018.rtf", b(3) se(3) r2 label nonum nogaps refcat(2.mun "Mun.size: House countryside") drop(1.mun) replace

drop if surveycovid==0

***Table S3c. Estimation of General and specific conspiratorial beliefs in 2020. Robustness checks

*Ideology 3 categories 
eststo clear 
eststo COVIDw_ideol3: reg conspir_covid woman c.age i.edu i.mun  i.ideol3 freedom_cont authority_cont like_incumbent [weight=weight]
eststo Conspiracyw_ideol3: reg rec_secret woman c.age i.edu i.mun  i.ideol3 freedom_cont authority_cont like_incumbent  [weight=weight]

*Ideology quadratic term
eststo COVIDw_ideolsq: reg conspir_covid woman c.age i.edu i.mun c.ideol##c.ideol freedom_cont authority_cont like_incumbent [weight=weight]
eststo Conspiracyw_ideolsq: reg rec_secret woman c.age i.edu i.mun c.ideol##c.ideol freedom_cont authority_cont like_incumbent  [weight=weight]

esttab COVIDw_ideol3 Conspiracyw_ideol3 COVIDw_ideolsq Conspiracyw_ideolsq using "ts3c_Robustnesschecks.rtf", b(3) se(3) r2 label nonum nogaps mtitle("COVID- Ideol" "General- Ideol" "COVID- Ideol2" "General- Ideol2") replace

***Figure S3a: Predicted levels of general conspiracy beliefs and COVID-19 related conspiracies, by ideology, freedom, critical towards authority and sympathy for the incumbent

*General CB
reg rec_secret  $controls [weight=weight]
margins, at(ideol=(0 (0.1) 1))
marginsplot, title(General conspiracy) xtitle(, height(5)) xlabel(0 "Left" 0.2 0.4 0.6 0.8 1 "Right") ytitle("Conspiracy beliefs", height(5)) name(ideol_conspiracy, replace)
margins, at(freedom=(0 1))
marginsplot, title(General conspiracy) xtitle("Security vs freedom", height(5)) xlabel(0 "Security" 1 "Freedom") ytitle("Conspiracy beliefs", height(5)) name(freedom_conspiracy, replace)
margins, at(authority=(0 1))
marginsplot, title(General conspiracy) xtitle("Critical with Authority", height(5)) xlabel(0 `""Respect" "authority""' 1 `""Critical" "authority""') ytitle("Conspiracy beliefs", height(5)) name(authority_conspiracy, replace)
margins, at(like_incumbent=(0(0.1)1))
marginsplot, title(General conspiracy) xtitle("Sympathy for the incumbent", height(5)) xlabel(0 `""Dislikes" "a lot""' 1 `""Likes" "a lot""') ytitle("Conspiracy beliefs", height(5)) name(incumbent_conspiracy, replace)

*COVID-19 CB
reg conspir_covid  $controls  [weight=weight]
margins, at(ideol=(0 (0.1) 1))
marginsplot, title("COVID-19 related CB") xtitle(, height(5)) xlabel(0 "Left" 0.2 0.4 0.6 0.8 1 "Right") ytitle("COVID-19 related conspiracies", height(5)) name(ideol_covid, replace)
margins, at(freedom=(0 1))
marginsplot, title("COVID-19 related CB") xtitle("Security vs freedom", height(5)) xlabel(0 "Security" 1 "Freedom") ytitle("COVID-19 related conspiracies", height(5))  name(freedom_covid, replace)
margins, at(authority=(0 1))
marginsplot, title("COVID-19 related CB") xtitle("Critical with Authority", height(5)) xlabel(0 `""Respect" "authority""' 1 `""Critical" "authority""') ytitle("Conspiracy beliefs", height(5)) name(authority_covid, replace)
margins, at(like_incumbent =(0(0.1)1))
marginsplot, title("COVID-19 related CB") xtitle("Sympathy for the incumbent", height(5)) xlabel(0 `""Dislikes" "a lot""' 1 `""Likes" "a lot""') ytitle("Conspiracy beliefs", height(5)) name(incumbent_covid, replace)

*Combine
graph combine ideol_covid ideol_conspiracy , scheme(plottig)  title(Ideology, size(msmall)) ycommon name(ideology, replace)
graph close ideol_*
graph combine freedom_covid freedom_conspiracy , scheme(plottig)  title(Freedom before security, size(msmall)) ycommon name(freedom, replace)
graph close freedom_*
graph combine authority_covid authority_conspiracy , scheme(plottig)  title(Critical with authority, size(msmall)) ycommon name(authority, replace)
graph close authority_*
graph combine incumbent_covid incumbent_conspiracy , scheme(plottig)  title(Sympathy for the incumbent, size(msmall)) ycommon name(incumbent, replace)
graph close incumbent_*

graph combine ideology freedom authority incumbent,  scheme(plottig)  xsize(8) ysize(10) col(1) scale(0.9) name(fs3b_ideol_free_auth_inc, replace)
graph export "fs3a_ideol_free_auth_inc.png", replace
graph close ideology freedom authority

***Figure S4a: Differences between general conspiracy beliefs and COVID-19 related conspiracies 
hist conspir_dif , bin(12) color(%60) scale(0.8) percent ytitle(, height(4)) xlabel(-4 `""Only""COVID""' -2 0 2 3.9 `""Only""general""') name(fs3a_hist_COVIDdif, replace)
graph export "fs4a_hist_COVIDdif.png", replace

***Figure S4b: Predicted levels of differences between general conspiracy beliefs and COVID-19 related conspiracies

eststo clear 
reg conspir_dif $controls  [weight=weight]
global coeflabels "coeflabels(woman= "Woman" age="Age" 1.mun ="Mun.size: House in countryside" 2.mun ="Mun.size: Small/medium city" 3.mun ="Mun.size: Big city/outskirts" 1.edu="Education: Primary" 2.edu="Education: Secondary" 3.edu="Education: University"  1.freedom="Freedom before security" , labsize(small) wrap(90))"
global style "level(95 90) fxsize(90) xline(0) byopts( cols(4)) scheme(plottig) note("Whiskers indicate 90 and 95% CI", pos(7) size(vsmall))"

coefplot , drop(_cons) $coeflabels $style label(off) name(f3_COVIDdif, replace)
graph export "fs4b_COVIDdif.png", replace
eststo clear 

***Figure S4c: Predicted levels of differences between general conspiracy beliefs and COVID-19 related conspiracies, by ideology, freedom, critical towards authority and sympathy towards the incumbent
quiet reg conspir_dif $controls  [weight=weight]
margins, at(ideol=(0 (0.1) 1))
marginsplot, title(Ideology) xtitle(, height(5)) xlabel(0 "Left" 0.2 0.4 0.6 0.8 1 "Right") ytitle("Difference General - COVID CB", height(5)) scale(0.9) name(ideol_dif, replace)

margins, at(freedom=(0 1))
marginsplot, title(Security vs freedom) xtitle(, height(5)) xlabel(0 "Security" 1 "Freedom") ytitle("Difference General - COVID CB", height(5)) scale(0.9) name(freedom_dif, replace)

margins, at(authority=(0 1))
marginsplot, title("Critical with Authority") xtitle(, height(5)) xlabel(0 `""Respect" "authority""' 1 `""Critical " "authority ""') ytitle("Difference General - COVID CB", height(5)) scale(0.9) name(authority_dif, replace)

margins, at(like_incumbent=(0(0.1)1))
marginsplot, title("Sympathy for the incumbent") xtitle(, height(5)) xlabel(0 `""Dislikes" "a lot""' 1 `""Likes" "a lot""') ytitle("Difference General - COVID CB", height(5)) scale(0.9) name(incumbent_dif, replace)

graph combine ideol_dif freedom_dif authority_dif incumbent_dif, col(2)  name(combine_dif, replace)
graph export "fs4c_COVIDdif.png", replace
eststo clear 

*****************************************************************************************************************
*****************************************************************************************************************

***Additional analyses

***Sympaty for parties
rename like_* *
rename incumbent like_incumbent
foreach var of varlist PSOE Podemos PP Cs VOX {
hist `var' [fweight=fweight], bin(21) percent name(`var', replace) scale(0.9) xtitle("Likes the party") title(`var')
graph close `var'
}
graph combine PSOE Podemos PP Cs VOX, col(2) name(likeparties, replace)

***Predicted levels of COVID-19 related conspiracies, by ideology and freedom, 2 and 3 items

*COVID-19 CB 3 items 
quiet reg conspir_covid  $controls  [weight=weight]
margins, at(ideol=(0 (0.1) 1))
marginsplot, title("COVID-19 related CB [3 items]") xtitle(, height(5)) xlabel(0 "Left" 0.2 0.4 0.6 0.8 1 "Right") ytitle("COVID-19 related conspiracies", height(5)) name(ideol_covid, replace)
margins, at(freedom=(0 1))
marginsplot, title("COVID-19 related CB [3 items]") xtitle("Security vs freedom", height(5)) xlabel(0 "Security" 1 "Freedom") ytitle("COVID-19 related conspiracies", height(5))  name(freedom_covid, replace)
margins, at(authority=(0 1))
marginsplot, title("COVID-19 related CB [3 items]") xtitle("Critical with Authority", height(5)) xlabel(0 `""Respect" "authority""' 1 `""Critical" "authority""') ytitle("Conspiracy beliefs", height(5)) name(authority_covid, replace)
margins, at(like_incumbent=(0 1))
marginsplot, title("COVID-19 related CB [3 items]") xtitle("Sympathy for the incumbent", height(5)) xlabel(0 `""Not" "at all""' 1 `""A" "lot""') ytitle("Conspiracy beliefs", height(5)) name(incumbent_covid, replace)

*COVID-19 CB 2 items
quiet reg conspir_covid2  $controls  [weight=weight]
margins, at(ideol=(0 (0.1) 1))
marginsplot, title("COVID-19 related CB [2 items]") xtitle(, height(5)) xlabel(0 "Left" 0.2 0.4 0.6 0.8 1 "Right") ytitle("Conspiracy beliefs", height(5)) scale(0.9) name(ideol_covid2, replace)
margins, at(freedom=(0 1))
marginsplot, title("COVID-19 related CB [2 items]") xtitle("Security vs freedom", height(5)) xlabel(0 "Security" 1 "Freedom") ytitle("Conspiracy beliefs", height(5)) scale(0.9)  name(freedom_covid2, replace)
margins, at(authority=(0 1))
marginsplot, title("COVID-19 related CB [2 items]") xtitle("Critical with Authority", height(5)) xlabel(0 `""Respect" "authority""' 1 `""Critical" "authority""') ytitle("Conspiracy beliefs", height(5)) scale(0.9) name(authority_covid2, replace)
margins, at(like_incumbent=(0 1))
marginsplot, title("COVID-19 related CB [2 items]") xtitle("Sympathy for the incumbent", height(5)) xlabel(0 `""Not" "at all""' 1 `""A" "lot""') ytitle("Conspiracy beliefs", height(5)) scale(0.9)  name(incumbent_covid2, replace)

graph combine ideol_covid ideol_covid2 , scheme(plottig)  title(Ideology, size(msmall)) ycommon name(ideology2, replace)
graph close ideol_*

graph combine freedom_covid freedom_covid2 , scheme(plottig)  title(Freedom before security, size(msmall)) ycommon name(freedom2, replace)
graph close freedom_*

graph combine authority_covid authority_covid2 , scheme(plottig)  title(Critical with authority, size(msmall)) ycommon name(authority2, replace)
graph close authority_*

graph combine incumbent_covid incumbent_covid2 , scheme(plottig)  title(Sympathy for the incumbent, size(msmall)) ycommon name(incumbent2, replace)
graph close incumbent_*


graph combine ideology2 freedom2 authority2 incumbent2,  scheme(plottig)  xsize(8) ysize(10) col(1) scale(0.9) name(add_ideol_free_auth, replace)
graph close ideology2 freedom2 authority2 incumbent2

*** END DO-FILE.